-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `local_smmy_oms`
--

-- --------------------------------------------------------

--
-- Table structure for table `ci_sessions`
--

CREATE TABLE IF NOT EXISTS `ci_sessions` (
  `id` varchar(128) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `timestamp` varchar(100) NOT NULL,
  `data` blob NOT NULL,
  PRIMARY KEY (`id`,`ip_address`),
  KEY `ci_sessions_timestamp` (`timestamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_admin_memo`
--

CREATE TABLE IF NOT EXISTS `oms_admin_memo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_id` int(11) NOT NULL,
  `important` int(1) NOT NULL DEFAULT '0',
  `title` varchar(100) NOT NULL,
  `description` varchar(5000) NOT NULL,
  `status` int(1) NOT NULL DEFAULT '1' COMMENT '0=delete\r\n1=publish',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Triggers `oms_admin_memo`
--
DROP TRIGGER IF EXISTS `admin memo message`;
DELIMITER $$
CREATE TRIGGER `admin memo message` BEFORE INSERT ON `oms_admin_memo` FOR EACH ROW INSERT INTO `oms_staff_message` VALUES (NULL, 3, 0 ,NEW.id,NEW.title,NEW.description,New.date_added,1,CURRENT_TIMESTAMP)
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `oms_admin_memo_mailing`
--

CREATE TABLE IF NOT EXISTS `oms_admin_memo_mailing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `memo_id` int(10) UNSIGNED NOT NULL,
  `mailing_to` varchar(100) NOT NULL,
  `mailing_title` varchar(255) NOT NULL,
  `mailing_subject` varchar(255) NOT NULL,
  `mailing_message` varchar(255) NOT NULL,
  `mailing_done` tinyint(2) NOT NULL DEFAULT '0',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application`
--

CREATE TABLE IF NOT EXISTS `oms_application` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `application_type_id` int(3) NOT NULL DEFAULT '1',
  `reason` varchar(200) NOT NULL,
  `attachment` varchar(100) DEFAULT NULL,
  `day` double(16,2) NOT NULL,
  `year` varchar(4) DEFAULT NULL,
  `status` int(2) NOT NULL DEFAULT '1' COMMENT '1=pending\r\n2=approve\r\n3=reject\r\n4=cancel',
  `approved_by` int(11) NOT NULL DEFAULT '0' COMMENT 'admin id\r\n0=new request',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `application_type_id` (`application_type_id`,`status`,`approved_by`)
) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;

--
-- Triggers `oms_application`
--
DROP TRIGGER IF EXISTS `application message`;
DELIMITER $$
CREATE TRIGGER `application message` AFTER INSERT ON `oms_application` FOR EACH ROW INSERT INTO `oms_staff_message` VALUES (NULL, 1,NEW.staff_id,NEW.id,'New application',NEW.reason,New.date_added,1,CURRENT_TIMESTAMP)
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application_admin_message`
--

CREATE TABLE IF NOT EXISTS `oms_application_admin_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `application_id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `title` varchar(100) NOT NULL,
  `description` varchar(8000) NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application_date`
--

CREATE TABLE IF NOT EXISTS `oms_application_date` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `application_id` int(11) NOT NULL,
  `year` varchar(4) NOT NULL,
  `date` date NOT NULL,
  `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=full day\r\n2=half day',
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application_group`
--

CREATE TABLE IF NOT EXISTS `oms_application_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `application_id` int(11) NOT NULL,
  `application_message_id` int(11) NOT NULL,
  `status` int(2) NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application_mailing`
--

CREATE TABLE IF NOT EXISTS `oms_application_mailing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `application_id` int(11) NOT NULL,
  `mailing_to` varchar(100) NOT NULL,
  `mailing_title` varchar(255) NOT NULL,
  `mailing_subject` varchar(255) NOT NULL,
  `mailing_message` varchar(255) NOT NULL,
  `mailing_done` tinyint(1) NOT NULL DEFAULT '0',
  `mailing_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application_staff_message`
--

CREATE TABLE IF NOT EXISTS `oms_application_staff_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `application_id` int(11) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `title` varchar(100) NOT NULL,
  `description` varchar(8000) DEFAULT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_application_type`
--

CREATE TABLE IF NOT EXISTS `oms_application_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '1',
  `status` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_attendant`
--

CREATE TABLE IF NOT EXISTS `oms_attendant` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `month` varchar(10) NOT NULL,
  `total_hours` double(16,2) NOT NULL COMMENT 'hours',
  `lateness` double(16,2) NOT NULL COMMENT 'minutes',
  `overtime` double(16,2) NOT NULL COMMENT 'hours',
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_attendant_hours`
--

CREATE TABLE IF NOT EXISTS `oms_attendant_hours` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `attendant_id` int(10) UNSIGNED NOT NULL,
  `day` tinyint(2) UNSIGNED NOT NULL,
  `before_noon_in` time DEFAULT NULL,
  `before_noon_out` time DEFAULT NULL,
  `after_noon_in` time DEFAULT NULL,
  `after_noon_out` time DEFAULT NULL,
  `overtime_in` time DEFAULT NULL,
  `overtime_out` time DEFAULT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `late` tinyint(1) NOT NULL DEFAULT '0',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_claim`
--

CREATE TABLE IF NOT EXISTS `oms_claim` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `claim_type_id` int(3) NOT NULL DEFAULT '1',
  `remark` varchar(200) NOT NULL,
  `attachment` varchar(100) DEFAULT NULL,
  `day` int(11) NOT NULL,
  `claim_date` date NOT NULL,
  `amount` double(16,2) NOT NULL,
  `status` int(2) NOT NULL DEFAULT '1' COMMENT '1=pending\r\n2=approve\r\n3=reject\r\n4=cancel',
  `approved_by` int(11) NOT NULL DEFAULT '0' COMMENT 'admin id\r\n0=new request',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;

--
-- Triggers `oms_claim`
--
DROP TRIGGER IF EXISTS `claim_message`;
DELIMITER $$
CREATE TRIGGER `claim_message` AFTER INSERT ON `oms_claim` FOR EACH ROW INSERT INTO `oms_staff_message` VALUES (NULL, 2,NEW.staff_id,NEW.id,'New claim',NEW.remark,New.date_added,1,CURRENT_TIMESTAMP)
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `oms_claim_admin_message`
--

CREATE TABLE IF NOT EXISTS `oms_claim_admin_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `claim_id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `title` varchar(100) NOT NULL,
  `description` varchar(8000) NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_claim_group`
--

CREATE TABLE IF NOT EXISTS `oms_claim_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `claim_id` int(11) NOT NULL,
  `claim_message_id` int(11) NOT NULL,
  `status` int(2) NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_claim_mailing`
--

CREATE TABLE IF NOT EXISTS `oms_claim_mailing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `claim_id` int(11) NOT NULL,
  `mailing_to` varchar(100) NOT NULL,
  `mailing_title` varchar(255) NOT NULL,
  `mailing_subject` varchar(255) NOT NULL,
  `mailing_message` varchar(255) NOT NULL,
  `mailing_done` tinyint(1) NOT NULL DEFAULT '0',
  `mailing_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_claim_staff_message`
--

CREATE TABLE IF NOT EXISTS `oms_claim_staff_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `claim_id` int(11) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `title` varchar(100) NOT NULL,
  `description` varchar(8000) DEFAULT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_claim_type`
--

CREATE TABLE IF NOT EXISTS `oms_claim_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `status` int(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_department`
--

CREATE TABLE IF NOT EXISTS `oms_department` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `status` int(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_department_discussion`
--

CREATE TABLE IF NOT EXISTS `oms_department_discussion` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_id` int(10) UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `discussion_mode` tinyint(1) NOT NULL DEFAULT '1',
  `discusstion_on_date` datetime DEFAULT NULL,
  `discussion_off_date` datetime DEFAULT NULL,
  `last_staff_id` int(11) NOT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

--
-- Triggers `oms_department_discussion`
--
DROP TRIGGER IF EXISTS `update discussion`;
DELIMITER $$
CREATE TRIGGER `update discussion` AFTER UPDATE ON `oms_department_discussion` FOR EACH ROW INSERT INTO oms_department_discussion_log VALUES (null,NEW.id,NEW.last_staff_id,NEW.title,NEW.last_update)
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `oms_department_discussion_comment`
--

CREATE TABLE IF NOT EXISTS `oms_department_discussion_comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_discussion_id` int(11) NOT NULL,
  `comment` varchar(1000) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_department_discussion_comment_attachment`
--

CREATE TABLE IF NOT EXISTS `oms_department_discussion_comment_attachment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_discussion_comment_id` int(11) NOT NULL,
  `attachment` varchar(255) NOT NULL,
  `extention` varchar(100) DEFAULT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_department_discussion_log`
--

CREATE TABLE IF NOT EXISTS `oms_department_discussion_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `department_discussion_id` int(11) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `update_title` varchar(100) DEFAULT NULL,
  `date_added` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_department_memo`
--

CREATE TABLE IF NOT EXISTS `oms_department_memo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `department_id` int(11) NOT NULL,
  `important` int(1) NOT NULL DEFAULT '0',
  `title` varchar(100) NOT NULL,
  `description` varchar(5000) NOT NULL,
  `status` int(1) NOT NULL DEFAULT '1' COMMENT '0=delete\r\n1=publish',
  `delete_staff_id` int(11) NOT NULL DEFAULT '0',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_log_sys_user`
--

CREATE TABLE IF NOT EXISTS `oms_log_sys_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `ip_address` varchar(20) NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_my_bank`
--

CREATE TABLE IF NOT EXISTS `oms_my_bank` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_message`
--

CREATE TABLE IF NOT EXISTS `oms_staff_message` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `message_type_id` int(11) NOT NULL,
  `staff_id` int(11) DEFAULT NULL,
  `content_id` int(11) NOT NULL,
  `message_title` varchar(100) NOT NULL,
  `message_content` varchar(255) NOT NULL,
  `message_date` datetime NOT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

--
-- Triggers `oms_staff_message`
--
DROP TRIGGER IF EXISTS `message readed`;
DELIMITER $$
CREATE TRIGGER `message readed` AFTER INSERT ON `oms_staff_message` FOR EACH ROW INSERT INTO `oms_staff_message_mark_read` VALUES (NULL,NEW.staff_id,NEW.id,0,NULL,CURRENT_TIMESTAMP)
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_message_mark_read`
--

CREATE TABLE IF NOT EXISTS `oms_staff_message_mark_read` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `message_id` int(11) NOT NULL,
  `read` tinyint(1) NOT NULL DEFAULT '0',
  `readed_date` datetime DEFAULT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_message_type`
--

CREATE TABLE IF NOT EXISTS `oms_staff_message_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_payroll`
--

CREATE TABLE IF NOT EXISTS `oms_staff_payroll` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_id` int(11) NOT NULL,
  `staff_id` int(11) NOT NULL,
  `basic_salary` double NOT NULL,
  `epf_employer_contribute` double(16,2) NOT NULL,
  `epf_employee_contribute` double(16,2) NOT NULL,
  `socso_employer_contribute` double(16,2) NOT NULL,
  `socso_employee_contribute` double(16,2) NOT NULL,
  `eis_employer_contribute` double(16,2) NOT NULL,
  `eis_employee_contribute` double(16,2) NOT NULL,
  `total_epf_contribute` double(16,2) NOT NULL,
  `total_socso_contribute` double(16,2) NOT NULL,
  `total_eis_contribute` double(16,2) NOT NULL,
  `payroll_day` varchar(7) NOT NULL,
  `payroll_type_id` tinyint(2) NOT NULL DEFAULT '1',
  `payment_date` date DEFAULT NULL,
  `payment_approval` int(11) DEFAULT NULL,
  `status` int(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_payroll_addition`
--

CREATE TABLE IF NOT EXISTS `oms_staff_payroll_addition` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payroll_id` int(11) NOT NULL,
  `pay_title` varchar(255) NOT NULL,
  `pay_type` tinyint(1) NOT NULL,
  `pay_date` varchar(7) NOT NULL,
  `pay_amount` double(16,2) NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `payroll_id` (`payroll_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_payroll_addition_type`
--

CREATE TABLE IF NOT EXISTS `oms_staff_payroll_addition_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_payroll_type`
--

CREATE TABLE IF NOT EXISTS `oms_staff_payroll_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_staff_salary_wallet`
--

CREATE TABLE IF NOT EXISTS `oms_staff_salary_wallet` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `start_salary` double(16,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_groups`
--

CREATE TABLE IF NOT EXISTS `oms_sys_groups` (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  `admin_group` tinyint(1) NOT NULL DEFAULT '0',
  `name` varchar(20) NOT NULL,
  `description` varchar(100) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `oms_sys_groups`
--

INSERT INTO `oms_sys_groups` (`id`, `admin_group`, `name`, `description`, `status`) VALUES
(1, 1, 'admin', 'Administrator', 1),
(2, 0, 'members', 'General User', 1);

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_groups_permission`
--

CREATE TABLE IF NOT EXISTS `oms_sys_groups_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `group_id` int(11) NOT NULL,
  `modules_function_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `allow_view` tinyint(1) NOT NULL DEFAULT '1',
  `allow_verify` tinyint(1) NOT NULL DEFAULT '1',
  `allow_create` tinyint(1) NOT NULL DEFAULT '1',
  `allow_update` tinyint(1) NOT NULL DEFAULT '1',
  `allow_delete` tinyint(1) NOT NULL DEFAULT '1',
  `allow_all` tinyint(1) NOT NULL DEFAULT '1',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `user_id` int(11) NOT NULL,
  `last_user_id` int(11) NOT NULL,
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=84 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `oms_sys_groups_permission`
--

INSERT INTO `oms_sys_groups_permission` (`id`, `group_id`, `modules_function_id`, `name`, `allow_view`, `allow_verify`, `allow_create`, `allow_update`, `allow_delete`, `allow_all`, `status`, `user_id`, `last_user_id`, `date_added`, `last_update`) VALUES
(1, 3, 1, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-28 01:51:55'),
(2, 3, 2, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(3, 3, 3, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(4, 3, 4, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(5, 3, 5, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(6, 3, 6, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(7, 3, 7, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(8, 3, 8, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(9, 3, 9, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(10, 3, 10, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 06:14:50'),
(11, 3, 11, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 02:44:31', '2022-01-27 07:08:12'),
(12, 2, 1, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(13, 2, 2, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(14, 2, 3, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(15, 2, 4, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(16, 2, 5, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(17, 2, 6, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(18, 2, 7, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(19, 2, 8, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(20, 2, 9, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(21, 2, 10, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(22, 2, 11, '', 0, 0, 0, 0, 0, 0, 1, 5, 5, '2022-01-27 07:10:49', '2022-02-23 00:54:39'),
(23, 1, 1, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(24, 1, 2, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(25, 1, 3, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(26, 1, 4, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(27, 1, 5, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(28, 1, 6, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(29, 1, 7, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:55', '2022-01-27 07:10:55'),
(30, 1, 8, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:56', '2022-02-21 02:24:28'),
(31, 1, 9, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:56', '2022-01-27 07:10:56'),
(32, 1, 10, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:56', '2022-01-27 07:10:56'),
(33, 1, 11, '', 1, 1, 1, 1, 1, 1, 1, 5, 5, '2022-01-27 07:10:56', '2022-01-27 07:10:56'),
(34, 1, 12, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-11 05:53:01', '2022-02-11 05:53:01'),
(35, 1, 13, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-11 05:53:01', '2022-02-11 05:53:01'),
(36, 2, 12, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-11 05:53:21', '2022-02-23 01:54:35'),
(37, 2, 13, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-11 05:53:21', '2022-02-23 01:54:35'),
(38, 1, 14, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-16 01:01:20', '2022-02-21 02:25:51'),
(39, 1, 15, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-16 01:01:20', '2022-02-16 01:01:20'),
(40, 1, 16, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-18 07:27:09', '2022-02-21 02:25:59'),
(41, 1, 17, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-21 01:58:36', '2022-02-21 02:08:39'),
(42, 1, 18, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-21 01:58:36', '2022-02-21 02:08:39'),
(43, 1, 19, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-21 01:58:36', '2022-02-21 02:08:39'),
(44, 1, 20, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-21 03:11:18', '2022-02-21 03:11:18'),
(45, 1, 21, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-22 01:06:26', '2022-02-22 01:06:26'),
(46, 1, 22, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-22 01:06:26', '2022-02-22 01:06:26'),
(47, 2, 14, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(48, 2, 15, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(49, 2, 16, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 01:54:35'),
(50, 2, 17, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(51, 2, 18, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(52, 2, 19, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(53, 2, 20, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(54, 2, 21, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-22 01:06:29'),
(55, 2, 22, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-22 01:06:29', '2022-02-23 00:54:39'),
(56, 2, 23, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 01:20:22', '2022-02-23 01:20:22'),
(57, 1, 23, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 01:20:27', '2022-02-23 02:26:49'),
(58, 2, 24, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 01:44:13', '2022-02-23 01:44:13'),
(61, 1, 24, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 01:44:44', '2022-02-23 01:54:02'),
(64, 2, 27, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 01:48:53', '2022-02-23 01:48:53'),
(65, 2, 28, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 01:48:53', '2022-02-23 01:48:53'),
(66, 2, 29, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 01:48:53', '2022-02-23 01:48:53'),
(67, 2, 30, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 01:48:53', '2022-02-23 01:48:53'),
(68, 1, 27, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 01:48:55', '2022-02-23 01:49:10'),
(69, 1, 28, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 01:48:55', '2022-02-23 01:49:10'),
(70, 1, 29, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 01:48:55', '2022-02-23 01:49:10'),
(71, 1, 30, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 01:48:55', '2022-02-23 01:49:10'),
(72, 2, 31, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 02:41:56', '2022-02-23 02:41:56'),
(73, 1, 31, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-23 02:41:59', '2022-02-23 02:42:04'),
(74, 2, 32, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 03:41:06', '2022-02-23 03:41:06'),
(75, 1, 32, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-23 03:41:14', '2022-02-23 03:41:14'),
(76, 1, 33, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-28 05:40:46', '2022-02-28 05:40:46'),
(77, 1, 34, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-28 05:40:46', '2022-02-28 05:40:46'),
(78, 1, 35, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-28 05:40:46', '2022-02-28 05:40:46'),
(79, 2, 33, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-28 05:44:42', '2022-02-28 05:44:54'),
(80, 2, 34, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-28 05:44:42', '2022-02-28 05:44:54'),
(81, 2, 35, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-28 05:44:42', '2022-02-28 05:44:54'),
(82, 2, 36, '', 1, 1, 1, 1, 1, 1, 1, 1, 1, '2022-02-28 05:45:49', '2022-02-28 05:45:49'),
(83, 1, 36, '', 0, 0, 0, 0, 0, 0, 1, 1, 1, '2022-02-28 05:45:55', '2022-02-28 05:46:01');

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_login_attempts`
--

CREATE TABLE IF NOT EXISTS `oms_sys_login_attempts` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `ip_address` varchar(45) NOT NULL,
  `login` varchar(100) NOT NULL,
  `time` int(11) UNSIGNED DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_modules`
--

CREATE TABLE IF NOT EXISTS `oms_sys_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `icon` varchar(100) NOT NULL DEFAULT 'fas fa-fw fa-cog',
  `controller` varchar(100) NOT NULL,
  `path` varchar(100) DEFAULT NULL,
  `dropdown` tinyint(1) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `oms_sys_modules`
--

INSERT INTO `oms_sys_modules` (`id`, `name`, `icon`, `controller`, `path`, `dropdown`, `status`, `date_added`, `last_update`) VALUES
(1, 'Manage User', 'fa fa-user', 'admin-permission', 'user_detail', 1, 1, '2022-01-26 02:03:54', '2022-01-26 02:04:08'),
(2, 'Manage Memo', 'fa fa-cog', 'admin', 'memo-detail', 1, 1, '2022-01-26 02:06:40', '2022-01-26 02:07:39'),
(3, 'Manage Staff', 'fa fa-cog', 'admin', 'staff-detail', 1, 1, '2022-01-26 02:08:06', '2022-01-26 02:08:06'),
(4, 'Manage Department', 'fa fa-cog', 'admin', 'department-detail', 1, 1, '2022-01-26 02:08:23', '2022-01-26 02:08:23'),
(5, 'Manage Payroll', 'fa fa-cog', 'admin', 'salaries-detail', 1, 1, '2022-01-26 02:08:41', '2022-01-26 02:08:41'),
(6, 'Manage Application', 'fa fa-cog', 'admin', 'application-detail', 1, 1, '2022-01-26 02:08:53', '2022-01-26 02:08:53'),
(7, 'Manage Claim', 'fa fa-cog', 'admin', 'claim-detail', 1, 1, '2022-01-26 02:09:08', '2022-01-26 02:09:08'),
(8, 'Manage Task', 'fa fa-cog', 'admin', 'task-detail', 1, 1, '2022-02-16 00:59:30', '2022-02-16 01:01:50'),
(9, 'Dashboard', 'fa fa-dashboard', 'admin', NULL, 0, 99, '2022-02-23 01:20:13', '2022-02-23 01:32:46'),
(10, 'My task', 'fas fa-fw fa-cog', 'staff', NULL, 1, 1, '2022-02-23 01:29:04', '2022-02-23 01:32:43'),
(11, 'My application', 'fas fa-fw fa-cog', 'staff', NULL, 1, 1, '2022-02-23 01:32:08', '2022-02-23 01:32:08'),
(12, 'My claim', 'fas fa-fw fa-cog', 'staff', NULL, 1, 1, '2022-02-23 01:48:46', '2022-02-23 01:48:46'),
(14, 'Department discussion', 'fas fa-fw fa-cog', 'department-discussion', NULL, 1, 1, '2022-02-23 03:39:25', '2022-02-23 03:39:47'),
(15, 'Manage attendant ', 'fa fa-cog', 'admin', NULL, 1, 1, '2022-02-28 05:40:38', '2022-02-28 05:40:38'),
(16, 'My attendant', 'fa fa-cog', 'staff', NULL, 1, 1, '2022-02-28 05:45:42', '2022-02-28 05:45:42');

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_modules_function`
--

CREATE TABLE IF NOT EXISTS `oms_sys_modules_function` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modules_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `icon` varchar(100) NOT NULL DEFAULT 'fas fa-fw fa-cog',
  `controller` varchar(100) NOT NULL,
  `function` varchar(100) DEFAULT NULL,
  `path` varchar(200) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `show` tinyint(1) NOT NULL DEFAULT '1',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `oms_sys_modules_function`
--

INSERT INTO `oms_sys_modules_function` (`id`, `modules_id`, `name`, `icon`, `controller`, `function`, `path`, `remark`, `show`, `status`, `date_added`, `last_update`) VALUES
(1, 2, 'memo detail', 'fas fa-fw fa-cog', 'admin', NULL, 'memo-detail', 'memo detail', 1, 1, '2022-01-26 07:04:57', '2022-02-23 00:53:29'),
(2, 3, 'staff detail', 'fas fa-fw fa-cog', 'admin', NULL, 'staff-detail', 'staff detail', 1, 1, '2022-01-26 07:07:57', '2022-02-23 00:53:29'),
(3, 3, 'new staff', 'fas fa-fw fa-cog', 'admin', NULL, 'new-staff', 'new staff', 1, 1, '2022-01-26 07:11:11', '2022-02-23 00:53:29'),
(4, 4, 'department detail', 'fas fa-fw fa-cog', 'admin', NULL, 'department-detail', 'department detail', 1, 1, '2022-01-26 07:12:03', '2022-02-23 00:53:29'),
(5, 4, 'department employees', 'fas fa-fw fa-cog', 'admin', NULL, 'department-employees', 'department employees', 1, 1, '2022-01-26 07:14:51', '2022-02-23 00:53:29'),
(6, 5, 'salaries detail', 'fas fa-fw fa-cog', 'admin', NULL, 'salaries-detail', 'salaries detail', 1, 1, '2022-01-26 07:37:41', '2022-02-23 00:53:29'),
(7, 5, 'new salary', 'fas fa-fw fa-cog', 'admin', NULL, 'new-salary', 'new salary', 1, 1, '2022-01-26 07:37:41', '2022-02-23 00:53:29'),
(8, 6, 'application-detail', 'fas fa-fw fa-cog', 'admin', NULL, 'application-detail', 'application-detail', 1, 1, '2022-01-26 07:39:24', '2022-02-23 00:53:29'),
(9, 6, 'application type', 'fas fa-fw fa-cog', 'admin', NULL, 'application-type', 'application type', 1, 1, '2022-01-26 07:39:24', '2022-02-23 00:53:29'),
(10, 7, 'claim-detail', 'fas fa-fw fa-cog', 'admin', NULL, 'claim-detail', 'claim-detail', 1, 1, '2022-01-26 07:40:03', '2022-02-23 00:53:29'),
(11, 7, 'claim type', 'fas fa-fw fa-cog', 'admin', NULL, 'claim-type', 'claim type', 1, 1, '2022-01-26 07:40:03', '2022-02-23 00:53:29'),
(12, 6, 'new application', 'fas fa-fw fa-cog', 'admin-apply', NULL, 'new-application', 'new application', 1, 1, '2022-01-28 08:53:44', '2022-02-23 00:53:29'),
(13, 7, 'new claim', 'fas fa-fw fa-cog', 'admin-apply', NULL, 'new-claim', 'new claim', 1, 1, '2022-01-28 08:55:01', '2022-02-23 00:53:29'),
(14, 8, 'task detail', 'fas fa-fw fa-cog', 'admin', NULL, 'task-detail', 'task detail', 1, 1, '2022-02-16 00:59:30', '2022-02-23 00:53:29'),
(15, 8, 'new task', 'fas fa-fw fa-cog', 'admin', NULL, 'new-task', 'new task', 1, 1, '2022-02-16 00:59:30', '2022-02-23 00:53:29'),
(16, 8, 'my task', 'fas fa-fw fa-cog', 'admin-apply', NULL, 'my-task', 'my task', 1, 1, '2022-02-18 07:26:56', '2022-02-23 00:53:29'),
(17, 1, 'system user', 'fas fa-fw fa-cog', 'admin-permission', NULL, 'user_detail', 'system user', 1, 1, '2022-02-21 01:58:21', '2022-02-23 00:53:29'),
(18, 1, 'system group', 'fas fa-fw fa-cog', 'admin-permission', NULL, 'groups', 'system group', 1, 1, '2022-02-21 01:58:21', '2022-02-23 00:53:29'),
(19, 1, 'system modules', 'fas fa-fw fa-cog', 'admin-permission', NULL, 'modules', 'system modules', 1, 1, '2022-02-21 01:58:21', '2022-02-23 00:53:29'),
(20, 8, 'edit task', 'fas fa-fw fa-cog', 'admin', NULL, 'edit-task', 'edit task', 0, 1, '2022-02-21 03:11:11', '2022-02-23 00:53:29'),
(21, 3, 'personal detail', 'fas fa-fw fa-cog', 'staff', NULL, 'personal-detail', 'personal detail', 0, 1, '2022-02-22 00:57:35', '2022-02-23 00:53:29'),
(22, 2, 'admin', 'fas fa-fw fa-cog', 'admin', NULL, NULL, 'admin', 0, 1, '2022-02-22 01:05:08', '2022-02-23 01:04:01'),
(23, 9, 'dashboard', 'fas fa-fw fa-cog', 'staff', NULL, NULL, 'staff dashboard', 1, 1, '2022-02-23 01:20:13', '2022-02-23 01:20:13'),
(24, 10, 'my task', 'fas fa-fw fa-cog', 'staff', NULL, 'task-detail', 'staff side task with user id', 1, 1, '2022-02-23 01:29:04', '2022-02-23 01:44:59'),
(27, 11, 'application detail', 'fas fa-fw fa-cog', 'staff', NULL, 'application-detail', NULL, 1, 1, '2022-02-23 01:45:27', '2022-02-23 01:50:46'),
(28, 11, 'apply leave', 'fas fa-fw fa-cog', 'staff', NULL, 'new-application', NULL, 1, 1, '2022-02-23 01:47:43', '2022-02-23 01:47:43'),
(29, 12, 'claim detail', 'fas fa-fw fa-cog', 'staff', NULL, 'claim-detail', NULL, 1, 1, '2022-02-23 01:48:46', '2022-02-23 01:51:28'),
(30, 12, 'new claim', 'fas fa-fw fa-cog', 'staff', NULL, 'new-claim', NULL, 1, 1, '2022-02-23 01:48:46', '2022-02-23 01:51:28'),
(31, 10, 'dashboard', 'fas fa-fw fa-cog', 'staff', NULL, NULL, 'staff dashboard', 0, 1, '2022-02-23 02:41:47', '2022-02-23 02:41:47'),
(32, 14, 'discussion board', 'fas fa-fw fa-cog', 'department-discussion', NULL, NULL, NULL, 1, 1, '2022-02-23 03:39:25', '2022-02-23 03:39:25'),
(33, 15, 'staff attendant', 'fas fa-fw fa-cog', 'admin', NULL, 'staff-attendant', NULL, 1, 1, '2022-02-28 05:40:38', '2022-02-28 05:44:28'),
(34, 15, 'new attendant', 'fas fa-fw fa-cog', 'admin', NULL, 'new-attendant', NULL, 1, 1, '2022-02-28 05:40:38', '2022-02-28 05:44:28'),
(35, 15, 'attendant calculation', 'fas fa-fw fa-cog', 'admin', NULL, 'attendant-calculation', NULL, 1, 1, '2022-02-28 05:40:38', '2022-02-28 05:44:28'),
(36, 16, 'attendant detail', 'fas fa-fw fa-cog', 'staff', NULL, 'attendant-detail', NULL, 1, 1, '2022-02-28 05:45:42', '2022-02-28 05:45:42');

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_modules_function_sort`
--

CREATE TABLE IF NOT EXISTS `oms_sys_modules_function_sort` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modules_function_id` int(11) NOT NULL,
  `sort` smallint(3) NOT NULL DEFAULT '0',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `modules_function_id` (`modules_function_id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

--
-- Dumping data for table `oms_sys_modules_function_sort`
--

INSERT INTO `oms_sys_modules_function_sort` (`id`, `modules_function_id`, `sort`, `date_added`, `last_update`) VALUES
(1, 1, 1, '2022-01-26 07:04:57', '2022-01-26 07:04:57'),
(2, 2, 2, '2022-01-26 07:07:57', '2022-01-26 07:07:57'),
(3, 3, 3, '2022-01-26 07:11:11', '2022-01-26 07:11:11'),
(4, 4, 4, '2022-01-26 07:12:03', '2022-01-26 07:12:03'),
(5, 5, 5, '2022-01-26 07:14:51', '2022-01-26 07:14:51'),
(6, 6, 6, '2022-01-26 07:37:41', '2022-01-26 07:37:41'),
(7, 7, 7, '2022-01-26 07:37:41', '2022-01-26 07:37:41'),
(8, 8, 8, '2022-01-26 07:39:24', '2022-01-26 07:39:24'),
(9, 9, 9, '2022-01-26 07:39:24', '2022-01-26 07:39:24'),
(10, 10, 10, '2022-01-26 07:40:03', '2022-01-26 07:40:03'),
(11, 11, 11, '2022-01-26 07:40:03', '2022-01-26 07:40:03'),
(12, 12, 12, '2022-01-28 08:53:44', '2022-01-28 08:53:44'),
(13, 13, 13, '2022-01-28 08:55:02', '2022-01-28 08:55:02'),
(14, 14, 14, '2022-02-16 00:59:30', '2022-02-16 00:59:30'),
(15, 15, 15, '2022-02-16 00:59:30', '2022-02-16 00:59:30'),
(16, 16, 16, '2022-02-18 07:26:56', '2022-02-18 07:26:56'),
(17, 17, 17, '2022-02-21 01:58:21', '2022-02-21 01:58:21'),
(18, 18, 18, '2022-02-21 01:58:21', '2022-02-21 01:58:21'),
(19, 19, 19, '2022-02-21 01:58:21', '2022-02-21 01:58:21'),
(20, 20, 20, '2022-02-21 03:11:11', '2022-02-21 03:11:11'),
(21, 21, 21, '2022-02-22 00:57:35', '2022-02-22 00:57:35'),
(22, 22, 22, '2022-02-22 01:05:08', '2022-02-22 01:05:08'),
(23, 23, 23, '2022-02-23 01:20:13', '2022-02-23 01:20:13'),
(24, 24, 24, '2022-02-23 01:29:04', '2022-02-23 01:29:04'),
(27, 27, 27, '2022-02-23 01:45:27', '2022-02-23 01:45:27'),
(28, 28, 28, '2022-02-23 01:47:43', '2022-02-23 01:47:43'),
(29, 29, 29, '2022-02-23 01:48:46', '2022-02-23 01:48:46'),
(30, 30, 30, '2022-02-23 01:48:46', '2022-02-23 01:48:46'),
(31, 31, 31, '2022-02-23 02:41:47', '2022-02-23 02:41:47'),
(32, 32, 32, '2022-02-23 03:39:25', '2022-02-23 03:39:25'),
(33, 33, 33, '2022-02-28 05:40:38', '2022-02-28 05:40:38'),
(34, 34, 34, '2022-02-28 05:40:38', '2022-02-28 05:40:38'),
(35, 35, 35, '2022-02-28 05:40:38', '2022-02-28 05:40:38'),
(36, 36, 36, '2022-02-28 05:45:42', '2022-02-28 05:45:42');

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_modules_sort`
--

CREATE TABLE IF NOT EXISTS `oms_sys_modules_sort` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modules_id` int(11) NOT NULL,
  `sort` smallint(3) NOT NULL DEFAULT '0',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `modules_id` (`modules_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `oms_sys_modules_sort`
--

INSERT INTO `oms_sys_modules_sort` (`id`, `modules_id`, `sort`, `date_added`, `last_update`) VALUES
(1, 1, 1, '2022-01-26 02:03:54', '2022-01-26 02:03:54'),
(2, 2, 2, '2022-01-26 02:06:40', '2022-01-26 02:06:40'),
(3, 3, 3, '2022-01-26 02:08:06', '2022-01-26 02:08:06'),
(4, 4, 4, '2022-01-26 02:08:23', '2022-01-26 02:08:23'),
(5, 5, 5, '2022-01-26 02:08:41', '2022-01-26 02:08:41'),
(6, 6, 6, '2022-01-26 02:08:53', '2022-01-26 02:08:53'),
(7, 7, 7, '2022-01-26 02:09:08', '2022-01-26 02:09:08'),
(8, 8, 8, '2022-02-16 00:59:30', '2022-02-16 00:59:30'),
(9, 9, 9, '2022-02-23 01:20:13', '2022-02-23 01:20:13'),
(10, 10, 10, '2022-02-23 01:29:04', '2022-02-23 01:29:04'),
(11, 11, 11, '2022-02-23 01:32:08', '2022-02-23 01:32:08'),
(12, 12, 12, '2022-02-23 01:48:46', '2022-02-23 01:48:46'),
(14, 14, 1, '2022-02-23 03:39:25', '2022-02-25 06:35:52'),
(15, 15, 13, '2022-02-28 05:40:38', '2022-02-28 05:40:38'),
(16, 16, 14, '2022-02-28 05:45:42', '2022-02-28 05:45:42');

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_users_groups`
--

CREATE TABLE IF NOT EXISTS `oms_sys_users_groups` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int(11) UNSIGNED NOT NULL,
  `group_id` mediumint(8) UNSIGNED NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
  KEY `fk_users_groups_users1_idx` (`user_id`),
  KEY `fk_users_groups_groups1_idx` (`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `oms_sys_users_groups`
--

INSERT INTO `oms_sys_users_groups` (`id`, `user_id`, `group_id`) VALUES
(16, 1, 1),
(17, 2, 2);

-- --------------------------------------------------------

--
-- Table structure for table `oms_sys_user_detail`
--

CREATE TABLE IF NOT EXISTS `oms_sys_user_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `epf_no` varchar(20) NOT NULL,
  `basic_salary` double(16,2) NOT NULL,
  `full_name` varchar(200) NOT NULL,
  `NRIC` varchar(12) NOT NULL,
  `email_address` varchar(100) NOT NULL,
  `phone` varchar(12) NOT NULL,
  `address` varchar(200) NOT NULL,
  `annual_leave` int(11) NOT NULL DEFAULT '7',
  `bank_id` int(11) DEFAULT NULL,
  `bank_account` varchar(30) DEFAULT NULL,
  `department_id` int(11) NOT NULL DEFAULT '0',
  `start_join` varchar(10) DEFAULT NULL,
  `end_join` date DEFAULT NULL,
  `DOB` date DEFAULT NULL,
  `status` int(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `bank_id` (`bank_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `oms_sys_user_detail`
--

INSERT INTO `oms_sys_user_detail` (`id`, `user_id`, `epf_no`, `basic_salary`, `full_name`, `NRIC`, `email_address`, `phone`, `address`, `annual_leave`, `bank_id`, `bank_account`, `department_id`, `start_join`, `end_join`, `DOB`, `status`, `date_added`, `last_update`) VALUES
(1, 2, '22131129', 1800.00, 'Valentine Chong Yuu Ted', '', 'valentinechong11@gmail.com', '01114068848', 'No 307 Taman Foong Joon Batu 2 1/2 Jalan Matang 93050 Kuching Sarawak', 7, 2, '111234309847', 1, '2021-10-05', NULL, NULL, 1, '2022-01-26 07:20:38', '2022-02-14 05:54:20');

-- --------------------------------------------------------

--
-- Table structure for table `oms_task`
--

CREATE TABLE IF NOT EXISTS `oms_task` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `task_name` varchar(100) NOT NULL,
  `task_description` varchar(200) DEFAULT NULL,
  `attachment` varchar(255) DEFAULT NULL,
  `due_date` datetime DEFAULT NULL,
  `done` tinyint(1) NOT NULL DEFAULT '0',
  `done_date` datetime DEFAULT NULL,
  `staff_id` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `last_user_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `oms_task_assign`
--

CREATE TABLE IF NOT EXISTS `oms_task_assign` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `staff_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `oms_sys_modules_function_sort`
--
ALTER TABLE `oms_sys_modules_function_sort`
  ADD CONSTRAINT `modules_function_id` FOREIGN KEY (`modules_function_id`) REFERENCES `oms_sys_modules_function` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

--
-- Constraints for table `oms_sys_modules_sort`
--
ALTER TABLE `oms_sys_modules_sort`
  ADD CONSTRAINT `modules_id` FOREIGN KEY (`modules_id`) REFERENCES `oms_sys_modules` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `oms_sys_users_groups`
--
ALTER TABLE `oms_sys_users_groups`
  ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `oms_sys_groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `oms_sys_user` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

--
-- Constraints for table `oms_sys_user_detail`
--
ALTER TABLE `oms_sys_user_detail`
  ADD CONSTRAINT `bank_id` FOREIGN KEY (`bank_id`) REFERENCES `oms_my_bank` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
COMMIT;

